package org.example.ch02.p12;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input=sc.nextLine();
        if (!input.matches("\\d+")){
            System.out.println("Invalid input");
            return;
        }
        int number=Integer.parseInt(input);
        if (number>=0&&number<=15){
            String hex=Integer.toHexString(number).toUpperCase();
            System.out.println(hex);
        }else{
            System.out.println("Invalid input");
        }
        sc.close();
    }
}
